//
//  Game2048.m
//  Game2048
//
//  Created by mis on 16/3/18.
//  Copyright © 2016年 mis. All rights reserved.
//

#import "Game2048.h"
#import "MainViewController.h"

@interface Game2048 ()
@property (nonatomic, strong) MainViewController *mainVC;
@end

@implementation Game2048

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    self.mainVC = [[MainViewController alloc] init];
    self.window.rootViewController = self.mainVC;
    self.window.backgroundColor = [UIColor groupTableViewBackgroundColor];
    [self.window makeKeyAndVisible];
    return YES;
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
    NSLog(@"程序进入后台");
    [self.mainVC didReceiveMemoryWarning]; // 释放内存的警告
    // 一旦进入后台  立即保存游戏数据相关数据
}

- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
    return UIInterfaceOrientationMaskPortrait; // 禁止屏幕旋转
}

@end
